import requests
headers={
    'User-Agent':"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 SLBrowser/8.0.0.12022 SLBChan/25"
}
url="https://tieba.baidu.com/f?"
page=2
number=0+50*(page-1)
params={
    "kw":"战狼",
    "ie":"utf-8",
    "pn":number
}
response=requests.get(url,headers=headers,params=params)
response.encoding="utf-8"
print(response.text)